﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>活动列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <link href="https://cdn.bootcss.com/amazeui/2.7.2/css/amazeui.css" rel="stylesheet" />
    <link href="http://s.amazeui.org/assets/2.x/css/amaze.min.css?v=ivneioml" rel="stylesheet" />
    <link href="css/common.css" rel="stylesheet" />
    <style>

        .veads_01 {
            height: 6rem;
            width: 100%;
            overflow: hidden;
            padding: 0 3%;
            line-height: 6rem;
            z-index: 999999999;
            position: relative;
            background: #fff;
            border-bottom: 1px solid #d3d3d3;
        }
    </style>
</head>
<body>
    <div id="page" v-cloak>

        <header data-am-widget="header" class="am-header am-header-default" style="background-color: #FFFFFF; border-bottom: 1px solid rgb(211, 211, 211);">
            <div class="am-header-left am-header-nav" onclick="goBack()">
                <a href="javascript:" class="">
                    <img class="am-header-icon-custom" src="images/veas07.png" alt="" />
                </a>
            </div>
            <h4 class="am-header-title" style=" color: black;">活动列表</h4>
            <div class="am-header-right am-header-nav"><a href="/Wap/Index.html" class="am-header-icon am-icon-home" style="color: #A9A9A9; "></a></div>
        </header>
        <form action="javascript:void(0)" class="am-form am-form-inline" style="position: relative; height:50px;">
            <div class="am-g" style="position: absolute; z-index: 1;">
                <nav data-am-widget="menu" class="am-menu  am-menu-default">
                    <a href="javascript: void(0)" class="am-menu-toggle">
                        <i class="am-menu-toggle-icon am-icon-bars"></i>
                    </a>
                    <ul class="am-menu-nav am-avg-sm-4">
                        <li class="am-parent">
                            <a href="javascript:void(0)" id="chosesport" class="" style="color:#757575;">上海</a>
                            <!--<ul class="am-menu-sub am-collapse  am-avg-sm-4 ">
                                <li class="am-text-center" v-for="(sport,index) in sportList" v-on:click="change(index)">
                                    <img v-bind:src="sport.Icon" style="width:60%;" />
                                    <a href="javascript:void(0)" class="">{{sport.Name}}</a>
                                </li>
                            </ul>-->
                        </li>
                    </ul>
                </nav>
            </div>

            <div class="am-g" style="position: absolute; z-index: 2; pointer-events: none; ">
                <div class="am-u-sm-9 am-u-sm-offset-3">
                    <div class="am-form-group am-form-icon" style="margin:8px 0 0 0;">
                        <i class="am-icon-search" style="color:#999999;"></i>
                        <input type="text" class="am-form-field" v-model="keyword" placeholder="活动名称" style=" pointer-events: auto;" />
                    </div>
                </div>
            </div>
        </form>

        <div class="am-g">
            <div data-am-widget="list_news" class="am-list-news am-list-news-default">
                <div class="am-list-news-bd">
                    <ul class="am-list">
                        <li v-on:click="ActivityInfo(activity.o.gId)" v-for="activity in activitylist" class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
                            <div class="am-u-sm-4 am-list-thumb">
                                <a href="" class="">
                                    <img v-bind:src="activity.o.faceImg" />
                                </a>
                            </div>
                            <div class=" am-u-sm-8 am-list-main">
                                <h3 class="am-list-item-hd">{{activity.o.Name}}</h3>
                                <div class="am-list-item-text">{{activity.o.Adress}}</div>
                                <div class="am-list-item-text">{{activity.o.Phone}}</div>
                                <div class="am-list-item-text">活动时间：{{activity.startTime}}-{{activity.endTime}}</div>
                                <div class="am-list-item-text">报名时间：{{activity.startSignTime}}-{{activity.endSignTime}}</div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div v-if="pageinfo.pageCount>page" class="am-list-news-ft" style="padding-bottom:15px;">
                <a class="am-list-news-more am-btn am-btn-default" v-on:click="page=page+1" href="javascript:void(0)">查看更多 &raquo;</a>
            </div>
            <div v-if="pageinfo.pageCount==page" class="am-list-news-ft" style="padding-bottom:15px;color:#757575;">
                无更多数据
            </div>
        </div>
    </div>
</body>
</html>
<script src="https://use.fontawesome.com/ca6b609d64.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.js"></script>
<script src="js/common.js"></script>
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
<script>
    var page = new Vue({
        el: '#page',
        data: {
            activitylist:[],
            page: 1,
            pagesize: 10,
            keyword: '',
            pageinfo: {},
        },
        methods: {
            getactivitylist: function () {
                var that = this;

                $.ajax({
                    type: 'Get',
                    data: { page: that.page, pagesize: that.pagesize, type: 1, keyword: that.keyword },
                    url: window.apiUrl + '/Api/Field/GetActivity',
                    success: function (data) {
                        console.log(data);
                        console.log(data.data.activityList);
                        if (data.errcode == 0) {
                            if (that.page == 1) {
                                that.activitylist = data.data.activityList;
                            } else {
                                $(data.data.activityList).each(function () {
                                    that.activitylist.push(this);
                                })
                            }
                            that.pageinfo = data.data.Page;
                        } else {
                            alert(data.errmsg);
                        }
                    },
                    //error: function () {
                    //    alert("服务器加载异常");
                    //}
                })
            },
            ActivityInfo: function (gId) {
                location.href = 'ActivityInfo.html?gId=' + gId;
            }
        },
        watch: {
            keyword: function () {
                this.page = 1;
                this.getactivitylist();
            },
            page: function () {
                this.getactivitylist();
            }
        }
    })
    $(function () {
        page.getactivitylist();
    })
</script>
